home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / GRAPHICS / POV_3 / SCENES / EXAMPLES / LEVEL3 / PENCIL / PENCIL.POV < prev   
Encoding:
Text File  |  2004-07-23  |  7.3 KB  |  271 lines

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // File by Jorge Arreguin
  3. // NOTE: Requires PENCIL_.GIF (320x200x256)
  4. // This scene file makes a pencil along y axis
  5. // with the label "Persistence Of Vision"
  6. //
  7. // Translation to English and dkb version 2.10 by Aaron a. Collins with a bit
  8. // of help from David on the imagemap registration.
  9. //
  10. // note - unless this is rendered at a minimum of 640 x whatever, the logo
  11. //        is quite unreadable.
  12. //
  13. // The Pencil - major export of Faber, Pennsylvania, due to the plentiful
  14. // presence of pencilwood trees and eraser-root plants, and the nearby
  15. // graphite mines.  (John Landis - Animal House)
  16. //
  17.  
  18. #version 3.0
  19. global_settings { assumed_gamma 2.2 }
  20.  
  21. #include "shapes.inc"
  22. #include "colors.inc"
  23. #include "textures.inc"
  24.  
  25. #declare PencilPaint = pigment { color red 1.0 green 0.6666 blue 0.33333 }
  26.  
  27. camera {
  28.    location <0.0, -70.0, 0.0>
  29.    direction <0.0, 2.5, 0.0>
  30.    up <0.0, 0.0, 1.0>
  31.    right <4/3, 0.0, 0.0>
  32.    rotate < -20.0, 0.0, -140.0 >
  33.    translate < 0.0, 0.0, 2.0 >
  34. }
  35.  
  36. light_source { <30.0, 30.0, 55.0>  colour White }
  37.  
  38. light_source { <-40.0, -40.0, 35.0> colour Grey }
  39.  
  40.  
  41. union {
  42.    /*----------------------------- parte metalica ----------------------*/
  43.    /*                             (that metal part)                     */
  44.    union {
  45.       union {
  46.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 2.0*z }
  47.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 1.0*z }
  48.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > }
  49.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -1.0*z }
  50.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -2.0*z }
  51.  
  52.          translate 38.5*z
  53.  
  54.          texture {
  55.             pigment { Gold }
  56.             finish { reflection 0.3 }
  57.          }
  58.       }
  59.  
  60.       union {
  61.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 2.0*z }
  62.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate 1.0*z }
  63.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > }
  64.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -1.0*z }
  65.          sphere { <0, 0, 0>, 1 scale < 4.0, 4.0, 1.5 > translate -2.0*z }
  66.  
  67.          translate 30.5*z
  68.  
  69.          texture {
  70.             pigment { Gold }
  71.             finish { reflection 0.3 }
  72.          }
  73.       }
  74.  
  75.       object {
  76.          Disk_Z
  77.          scale < 3.5, 3.5, 3.0 >
  78.          translate 34.0*z
  79.          texture {
  80.             pigment { Brown }
  81.             finish { reflection 0.25 }
  82.          }
  83.       }
  84.  
  85.       bounded_by { sphere { <0.0, 0.0, 34.0>, 9.0 } }
  86.    }
  87.  
  88.    /*---------------------------------- borrador ----------------------------*/
  89.    /*                (the rubber eraser, from eraser-root plants)            */
  90.  
  91.    union {
  92.       object {
  93.          Disk_Z
  94.          scale < 3.5, 3.5, 3.0 >
  95.          translate 41.0*z
  96.          texture {
  97.             pigment { Pink }
  98.          }
  99.       }
  100.       sphere {
  101.          < 0.0, 0.0, 44.0 >, 3.5
  102.          texture { pigment { Pink } }
  103.       }
  104.    }
  105.  
  106.    /*---------------------------------- cuerpo de madera ---------------------*/
  107.    /*                                 (body of pencilwood)                    */
  108.    difference {
  109.       intersection {
  110.          plane {
  111.             y, 3.031
  112.             texture { pigment { PencilPaint } }
  113.             texture {
  114.                pigment {
  115.                   image_map {
  116.                      gif "pencil_.gif" filter 0 1.0  /* colour 0 is the "key" or transparent colour */
  117.                      once
  118.                   }
  119.                   rotate <0, -90, -90>
  120.                   scale <15.0 ,1.0, 15.0>
  121.                   translate <-12.2, 0.0, 12.0 >
  122.                }
  123.             }
  124.  
  125.                /* Now for the complicated image mapping:
  126.   Currently, the pencil is standing up in the z axis:
  127.                    z
  128.  
  129.              eraser  ^ *vp
  130.                      | |   
  131.                      | |
  132.                      | |----/ y
  133.                      |     /
  134.                      |    /
  135.                      |   /
  136.                      |  /
  137.                      | /
  138.              point   |/
  139.                      -------------->
  140.                                    x
  141.  
  142.   We want the image to be mapped as follows (viewed from the +ve y axis):
  143.  
  144.           Right
  145.           ---- z=28.0
  146.           |  |
  147.           |..|
  148.           |..|
  149.           |..|
  150.           |ee|
  151.           |ce|
  152.       Top |ar| Bottom
  153.           |rf|
  154.           |t |
  155.           | s|
  156.           |b'|
  157.           |Kt|
  158.           |di|
  159.           ---- z=12.7
  160.           Left
  161.  
  162.           ^  ^
  163.           |  |
  164.     x=1.75   x=-1.75
  165.  
  166.  The image map above gives (viewed from the y axis):
  167.  
  168.                    ^ z
  169.           1,1 Right|
  170.              ------|
  171.              |     |
  172.              |     |
  173.          Top |     |Bottom
  174.              |     |
  175.              |     |
  176.          <----------
  177.           x   Left     
  178.  
  179.   Which is at least in the right orientation.
  180.  
  181.   Now, we must scale the image so the letters are the right size. */
  182.  
  183.                //         scale <15.0 1.0 15.0>  /* Never use 0 for any scale value */
  184.  
  185.                /* Now, we align the top left of the picture to the proper point on the
  186.   pencil.  This is a bit tricky because the top left of the picture is now
  187.   at x=15 z=0.  We have to move it to about x=-12, z=12 because the letters
  188.   don't start at the very top of the image. */
  189.  
  190.                //         translate <-12.20 0 12>
  191.  
  192.                /* As you may have guessed, this still took a lot of trial and error to get it
  193.   right, but some analysis of the picture before hand saved a lot of time. */
  194.                //      }
  195.  
  196.          }
  197.          plane {
  198.             y, 3.031
  199.             rotate 60.0*z
  200.             pigment { PencilPaint }
  201.          }
  202.          plane {
  203.             y, 3.031
  204.             rotate 120.0*z
  205.             pigment { PencilPaint }
  206.          }
  207.          plane {
  208.             y, 3.031
  209.             rotate 180.0*z
  210.             pigment { PencilPaint }
  211.          }
  212.          plane {
  213.             y, 3.031
  214.             rotate 240.0*z
  215.             pigment { PencilPaint }
  216.          }
  217.          plane {
  218.             y, 3.031
  219.             rotate 300.0*z
  220.             pigment { PencilPaint }
  221.          }
  222.          plane { z, 28.0 }
  223.          plane { z, 3.629 inverse }
  224.       }
  225.       object { QCone_Z inverse scale < 0.275558, 0.275558, 1.0 > }
  226.  
  227.       texture {
  228.          pigment {
  229.             Pine_Wood
  230.             turbulence 0.1
  231.             scale 1.5
  232.             rotate 90.0*y
  233.             translate 30.0*x
  234.          }
  235.       }
  236.    }
  237.  
  238.    /*---------------------------- punta de grafito ------------------------------*/
  239.    /*                            (point of graphite)                             */
  240.  
  241.    intersection {
  242.       object { QCone_Z scale < 0.275558, 0.275558, 1.0 > }
  243.       plane { z, 3.629 }
  244.       plane { z, 0.001 inverse }
  245.  
  246.       texture {
  247.          pigment { Black }
  248.          finish {
  249.             reflection 0.25
  250.             phong 1.0
  251.             phong_size 20
  252.          }
  253.       }
  254.    }
  255.  
  256.    rotate 90.0*x
  257.    translate < 0.0, 22.0, 3.5 >
  258. }
  259.  
  260. /*-------------------------- plano de horizonte --------------------------*/
  261. /*                           (plane of horizon)                           */
  262.  
  263. plane {
  264.    z, 0.0
  265.  
  266.    texture {
  267.       pigment { Green }
  268.       finish { reflection 0.25 }
  269.    }
  270. }
  271.